public
class MyThread extends Thread
{
	int delay;
	public MyThread(String name, int delay)
	{
		super();
		setName(name);
		this.delay = delay;
	}
	public void run()
	{
		for(int i = 0; i < 5; i++){
			System.out.println(getName());
			try{
				sleep(delay);
			}
			catch(InterruptedException e){
			}
		}
	}
	public static void main(String args[])
	{
		new MyThread("Pierwszy", 2).start();
		new MyThread("Drugi", 1).start();
	}
}
